Object.defineProperty(global, '__stack', {
    get: function () {
        var orig = Error.prepareStackTrace;
        Error.prepareStackTrace = function (_, stack) {
            return stack;
        };
        var err = new Error;
        Error.captureStackTrace(err, arguments.callee);
        var stack = err.stack;
        Error.prepareStackTrace = orig;
        return stack;
    }
})

Object.defineProperty(global, '__line', {
    get: function () {
        return __stack[1].getLineNumber();
    }
})

const log4js = require('log4js')
log4js.configure({
    appenders: {
        // zoro: {
        //     type: 'file', filename: config.domain == 'zoro.site' ? '/root/script/zoro.log' : 'zoro.log'
        // },
        stdout: {
            type: 'stdout'
        }
    },
    categories: {
        default: {
            appenders: ['stdout'],
            level: 'debug'
        }
    }
});